package tset1;

public class testdom24 {
    public static void main(String[] args) throws InterruptedException {
        Object object=new Object();
        Thread t1=new Thread(()->{
            System.out.println("wait之前....");
            try {
                synchronized (object){
                    object.wait();
                }
                System.out.println("wait之后....");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        Thread t2=new Thread(()->{
            System.out.println("通知唤醒t1....");
            synchronized (object){
                object.notify();
            }
            System.out.println("线程t2....");
        });
        t1.start();
        t2.start();
        t1.join();
        t2.join();
    }
}
